﻿<!DOCTYPE html>
<!--受限物管理-->
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="/static/js/common.js"></script>

</head>
<body>
    
<div id="app" v-cloak>   
        <el-form :model="Form" status-icon style="margin-top:5px;width:100%">
            <el-row>
                <el-col class="head-tool" span="10">
                    <el-button type="primary" @click="UserInput('xg')">{{col.btnAdd}}</el-button>
                    <!--<el-button type="danger" @click="onDelete">{{col.btnDelete}}</el-button>-->
                </el-col>
            </el-row>
            <el-row style="border:1px  solid;">
                <el-col span="24" style="  padding-left:30px; ">
                    <el-table :data="Form.RestrictedObject"
                              border
                              style="width: 100%">
                        <el-table-column type="index" :label="JobLicenseManagement.SerialNumber"
                                         :index="indexMethod" width="50" show-overflow-tooltip="true"></el-table-column>


                        <el-table-column prop="GoodsName"
                                         :label="RestrictedObject.GoodsName">
                        </el-table-column>
                        <el-table-column prop="Quantity"
                                         :label="RestrictedObject.Quantity">
                        </el-table-column>
                        <el-table-column prop="IntoRestrictedSpaceTime"
                                         :label="RestrictedPerson.IntoRestrictedSpaceTime">
                        </el-table-column>
                        <el-table-column prop="OutSpaceTime"
                                         :label="RestrictedPerson.OutSpaceTime">
                        </el-table-column>
                        <el-table-column prop="ConfirmationSignature"
                                         :label="RestrictedPerson.ConfirmationSignature">
                        </el-table-column>
                        <el-table-column prop="SignatureTime"
                                         :label="RestrictedPerson.SignatureTime">
                        </el-table-column>
                        <el-table-column label="操作">
                            <template slot-scope="scope">
                                <el-button @click.native.prevent="deleteRow(scope.$index, Form.RestrictedObject)"
                                           type="text"
                                           size="small">
                                    移除
                                </el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-col>
            </el-row>
            <el-row>
                <el-form-item style="text-align:center; padding-top:5px">
                    <el-button type="primary" @click="onSubmitForm('ruleForm')">{{col.btnSave}}</el-button>
                </el-form-item>
            </el-row>
        </el-form>
        <el-dialog title="" :visible.sync="ListItem.dialogVisible" width="90%" height="95%" top="10vh">
            <iframe ref="iframe" :src="ListItem.InputUrl" style="height:95%;width:100%" frameborder="0"></iframe>
        </el-dialog>
    </div>
    <script type="text/javascript">
        app = new Vue({
            el: '#app',
            data: {
                id: '',
                Form: {
                    id: guidEmpty,
                    RestrictedObject: []
                },
                WorkshopType: [],
                ListItem: ListItem,
            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                handleNodeClick: function (data) {
                    console.log(data);
                },
                handleSelect: function (ev) {
                    console.log(ev);
                },
                handleChecked: function (value) {
                },
                handleCheckedConfirmation: function (value) {
                },
                deleteRow: function (index, rows) {
                    rows.splice(index, 1);
                },
                getData: function () {
                    getDataAdd(this, '/api/ConfinedSpaceWorkSafety/getRestrictedObject?id=' + this.id);
                },

                UserInput: function (val) {
                    DialogShow(this, val, "RestrictedObjectInput.html", this.id);
                },
                Bianji: function (val, id) {

                    DialogShow(this, val, "RestrictedObjectInput.html", id);
                },

                indexMethod: function (index) {
                    return (this.ListItem.currentPage - 1) * this.ListItem.pagesize + index + 1;
                },

                //提交数据
                onSubmitForm: function (formName) {
                    var mythis = this;
                    //this.$refs[formName].validate(function (valid) {
                    //    //验证通过
                    //    if (valid) {
                    onSubmitForm(this, '/api/ConfinedSpaceWorkSafety/Save', mythis.Form);
                    //} else {
                    //    //验证失败
                    //    return false;
                    //}
                    //});
                },
            },
            mounted: function () {
                this.id = getUrlParam("id");
                this.getData();
            }
        });
    </script>
</body>
</html>